/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "moneda", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Moneda.findAll", query = "SELECT m FROM Moneda m"),
    @NamedQuery(name = "Moneda.findByIdmoneda", query = "SELECT m FROM Moneda m WHERE m.idmoneda = :idmoneda"),
    @NamedQuery(name = "Moneda.findByMoneDescrip", query = "SELECT m FROM Moneda m WHERE m.moneDescrip = :moneDescrip")})
public class Moneda implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idmoneda", nullable = false)
    private Integer idmoneda;
    @Column(name = "mone_descrip")
    private Integer moneDescrip;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idmoneda")
    private Collection<Cotizacion> cotizacionCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idmoneda")
    private Collection<Recaudaciones> recaudacionesCollection;

    public Moneda() {
    }

    public Moneda(Integer idmoneda) {
        this.idmoneda = idmoneda;
    }

    public Integer getIdmoneda() {
        return idmoneda;
    }

    public void setIdmoneda(Integer idmoneda) {
        this.idmoneda = idmoneda;
    }

    public Integer getMoneDescrip() {
        return moneDescrip;
    }

    public void setMoneDescrip(Integer moneDescrip) {
        this.moneDescrip = moneDescrip;
    }

    @XmlTransient
    public Collection<Cotizacion> getCotizacionCollection() {
        return cotizacionCollection;
    }

    public void setCotizacionCollection(Collection<Cotizacion> cotizacionCollection) {
        this.cotizacionCollection = cotizacionCollection;
    }

    @XmlTransient
    public Collection<Recaudaciones> getRecaudacionesCollection() {
        return recaudacionesCollection;
    }

    public void setRecaudacionesCollection(Collection<Recaudaciones> recaudacionesCollection) {
        this.recaudacionesCollection = recaudacionesCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idmoneda != null ? idmoneda.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Moneda)) {
            return false;
        }
        Moneda other = (Moneda) object;
        if ((this.idmoneda == null && other.idmoneda != null) || (this.idmoneda != null && !this.idmoneda.equals(other.idmoneda))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.Moneda[ idmoneda=" + idmoneda + " ]";
    }
    
}
